import { axios } from '@/utils/request'

// 获取推荐人列表
export function apiGetReferenceList() {
  return axios({
    url: '/sys/user/referenceList',
    method: 'post',
    data: {
      userTypeList: [1, 3]
    }
  })
}
export function apiAddAgent(data) {
  return axios({
    url: '/gzAgent/add',
    method: 'post',
    data
  })
}
export function apiEditAgent(data) {
  return axios({
    url: '/gzAgent/edit',
    method: 'post',
    data
  })
}
// 行内删除
export function apiDelAgent(id) {
  return axios({
    url: '/gzAgent/delete?id=' + id,
    method: 'delete'
  })
}
// 批量删除
export function apiDelAgentBatch(ids) {
  return axios({
    url: '/gzAgent/deleteBatch?ids=' + ids,
    method: 'delete'
  })
}
// 业务员列表
export function apiGetSalesmanList() {
  return axios({
    url: '/sys/user/list',
    method: 'get',
    params: {
      userType: '1',
      pageNo: 1,
      pageSize: 9999999
    }
  })
}
// 新增报价
export function apiAddQuotation(data) {
  return axios({
    url: '/gzPackagePrice/add',
    method: 'post',
    data
  })
}
// 编辑报价
export function apiEditQuotation(data) {
  return axios({
    url: '/gzPackagePrice/edit',
    method: 'post',
    data
  })
}

// 查询报价根据id
export function apiGetQuotationDetailById(id) {
  return axios({
    url: '/gzPackagePrice/queryById',
    method: 'get',
    params: { id }
  })
}
// 获取代理商
export function apiGetAgentList() {
  return axios({
    url: '/sys/user/list',
    method: 'get',
    params: {
      userType: '3',
      pageNo: 1,
      pageSize: 9999999
    }
  })
}
// 审核报价
export function apiApprove(data) {
  return axios({
    url: '/gzCustomInfo/examine',
    method: 'post',
    data
  })
}
// 复核报价
export function apiReApprove(data) {
  return axios({
    url: '/gzCustomInfo/auditAndReview',
    method: 'post',
    data
  })
}
// 撤销
export function apiRevoke(data) {
  return axios({
    url: '/gzCustomInfo/revoke',
    method: 'post',
    data
  })
}
// 省市区
export function apiGetOrganTree() {
  return axios({
    url: '/organ/tree',
    method: 'get',
  })
}
